﻿using System;
using YIUIBind;
using YIUIFramework;
using UnityEngine;
using UnityEngine.UI;
using System.Collections.Generic;
using Cysharp.Threading.Tasks;

namespace YIUI.Home
{



    /// <summary>
    /// 由YIUI工具自动创建 请勿手动修改
    /// </summary>
    public abstract class HomePanelBase:BasePanel
    {
        public const string PkgName = "Home";
        public const string ResName = "HomePanel";
        
        public override EWindowOption WindowOption => EWindowOption.None;
        public override EPanelLayer Layer => EPanelLayer.Panel;
        public override EPanelOption PanelOption => EPanelOption.None;
        public override EPanelStackOption StackOption => EPanelStackOption.VisibleTween;
        public override int Priority => 0;
        public YIUI.Common.ResAreaCommon u_UIM_itemResArea { get; private set; }
        protected UIEventP0 u_EventSpawn { get; private set; }
        protected UIEventHandleP0 u_EventSpawnHandle { get; private set; }
        protected UIEventP0 u_EventRecycle { get; private set; }
        protected UIEventHandleP0 u_EventRecycleHandle { get; private set; }

        
        protected sealed override void UIBind()
        {
            u_EventSpawn = EventTable.FindEvent<UIEventP0>("u_EventSpawn");
            u_EventSpawnHandle = u_EventSpawn.Add(OnEventSpawnAction);
            u_EventRecycle = EventTable.FindEvent<UIEventP0>("u_EventRecycle");
            u_EventRecycleHandle = u_EventRecycle.Add(OnEventRecycleAction);
            u_UIM_itemResArea = CDETable.FindUIBase<YIUI.Common.ResAreaCommon>("m_itemResArea");

        }

        protected sealed override void UnUIBind()
        {
            u_EventSpawn.Remove(u_EventSpawnHandle);
            u_EventRecycle.Remove(u_EventRecycleHandle);

        }
     
        protected virtual void OnEventSpawnAction(){}
        protected virtual void OnEventRecycleAction(){}
   
   
    }
}